home *** CD-ROM | disk | FTP | other *** search
/ Enter 2006 July / Enter 07 2006.iso / Internet / WinAgents RouterTweak 1.0 / rtsetup.exe / rtweak.chm / basics / mailto.js < prev    next >
Encoding:
JavaScript  |  2006-04-26  |  4.0 KB  |  117 lines

  1. //Final version 1.000.
  2.  
  3. function EMailStream(obj)
  4. {
  5. var stream;
  6. if(document.body.innerHTML.search(/fbRating/) != -1)  {fbReload();} 
  7.  
  8. // *****Start: Localization Section************************  
  9.  
  10. var fbTitle_Text = 'Documentation Feedback';
  11. var fbParagraph_Text = 'The WinAgents Softare Group will be appreciate your affords in order to make our documentation more clear and usefull. Please do not hesitate to contact us in order to get more information about our solutions and services.  You can quickly and directly send e-mail feedback using the link below.';
  12.     //---Note to localization: Do not change <A> and </A> tags.---
  13. var fbRateThisTopic_Text = 'Rate this topic (1-5):';
  14. var fbPoor_Text = "Poor";
  15. var fbExcellent_Text = "Excellent";
  16. var fbEnterFeedbackHere_Text = 'To submit written feedback about this topic, click here:';
  17. var fbCancel_Text = 'Cancel';
  18.  
  19. // ******End: Localization Section************************
  20. // *****(There is another localization section below.)*****
  21.  
  22. stream = '<DIV ID="feedbackarea">'
  23.     + '<br>'
  24.     + '<hr COLOR="#99CCFF">'
  25.     + '<H6 STYLE="margin-top:0.5em;">' + fbTitle_Text + '</H6>'
  26.     + '<P>' + fbParagraph_Text + '</P>'
  27.     + '<FORM METHOD="post" ENCTYPE="text/plain" NAME="formRating">'
  28.     + '<P>' + fbRateThisTopic_Text + '    '
  29.     + fbPoor_Text + ' <INPUT TYPE="radio" value="1" NAME="fbRating">'
  30.     + '<INPUT TYPE="radio" value="2" NAME="fbRating">'
  31.     + '<INPUT TYPE="radio" value="3" NAME="fbRating">'
  32.     + '<INPUT TYPE="radio" value="4" NAME="fbRating">'
  33.     + '<INPUT TYPE="radio" value="5" NAME="fbRating"> ' + fbExcellent_Text + '</P>'
  34.     + '</FORM>'
  35.     + '<P>' + fbEnterFeedbackHere_Text + '    '
  36.     + '<SPAN ONCLICK="feedbackarea.style.display=\'none\';' + obj.id + '.innerHTML=\'\'">'+ submitFeedback() + '</SPAN></P>'
  37.     + '<P STYLE="width:100%;position:relative;float:left;clear:left;margin-bottom:-0.7em;margin-top:0em;" align=right><A HREF="#Feedback" ONCLICK=EMailStream(' + obj.id + ')>' + fbCancel_Text
  38.     + '</A>       </P>'
  39.     + '<hr COLOR="#99CCFF">'
  40.     + '</div>';
  41.  
  42. obj.innerHTML = stream;
  43. }
  44.  
  45. function submitFeedback()
  46. {
  47.  
  48. // *****Start: Localization Section**********************
  49.  
  50. var fbTypeHere_Text = 'Please type comments here, leaving the subject line in place.'
  51. var fbSubmit_Text = 'Submit feedback';
  52.  
  53. // ******End: Localization Section***********************
  54.  
  55.  
  56.   var sRecipient = "mailto:support@winagents.com";
  57.   var sTitle = ParseTitle(document.title);
  58.   var sCHM = ParseFileName(window.location.href,1);
  59.   var sHTM = ParseFileName(window.location.href,2);
  60.   var sLang = navigator.systemLanguage;
  61.   
  62.  
  63.   var sSubject =  sTitle + ' (' + sCHM + '::/' + sHTM + '>>'  
  64.     + '\' + GetRating() + \':' + sLang + ')'; 
  65.  
  66.   var sEntireMailMessage = sRecipient + '?subject=' + sSubject 
  67.     + '&body=---' + fbTypeHere_Text + '---';
  68.  
  69.   var sHREF = '<A HREF=\"' + sRecipient + '" ONCLICK=\"this.href=\''
  70.     + sEntireMailMessage + '\';\">' + fbSubmit_Text + '</A>';
  71.  
  72.   return sHREF;
  73. }
  74.  
  75. //---Parses document title.---
  76. function ParseTitle(theTitle)
  77. {
  78.     theTitle = theTitle.replace(/\"/g,"--");
  79.       theTitle = theTitle.replace(/'/g,"-");
  80.     if (theTitle == "") {theTitle = "Documentation Feedback";}
  81.     if (theTitle.length > 60) {theTitle = theTitle.slice(0,57) + "...";}
  82.     return theTitle;
  83. }
  84.  
  85. //---Parses document filename.---
  86. function ParseFileName(Filename, theNum)
  87. {
  88.       var intPos = Filename.lastIndexOf("\\");
  89.       var intLen = Filename.length;
  90.       var newFileName = Filename.substr(intPos + 1, intLen  - intPos)
  91.       newFileName = newFileName.replace(/#Feedback/g,"");
  92.       var x = newFileName.lastIndexOf("/");
  93.  
  94.     if (theNum == 1) {newFileName = newFileName.substr(0, (x-2));}
  95.     if (theNum == 2) {newFileName = newFileName.substr(x + 1);}
  96.  
  97.       return(newFileName);
  98. }
  99.  
  100. function GetRating()
  101. {
  102.     sRating = "0";
  103.     for(var x = 0;x < 5;x++)
  104.       {
  105.               if(document.formRating.fbRating(x).checked) {sRating = x + 1;}
  106.       }
  107.     return sRating;
  108. }
  109.  
  110. //---Reloads window.---
  111. function fbReload()
  112. {
  113.     window.location.reload(true);
  114.  
  115. }
  116.  
  117.